/**   
* @Title:：RabbitClusterMsgDeliver.java 
* @Package ：com.example.deal.rabbit 
* @Description： TODO
* @author： Dustyone
* @date： 2019年4月4日 上午11:08:20  
*/
package com.example.deal.rabbit;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
import org.springframework.messaging.handler.annotation.SendTo;

/**
 * @ClassName:：RabbitClusterMsgDeliver
 * @author ：Dustyone
 * @date ：2019年4月4日 上午11:08:20
 */

@EnableBinding(RabbitClusterChannel.class)
public class RabbitClusterMsgRecieve {
	
	/**
	 * 
	* @author： Dustyone
	* @Title：asiaCdsBrokerWarningNotifyMsgRecieve 
	* @Description：TODO
	* @param ：@param message 
	* @return ：void 
	* @throws
	 */
	@StreamListener(RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING)
	//@Transformer(inputChannel = RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING,outputChannel = RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING)
	//@ServiceActivator(inputChannel = RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING,outputChannel = RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING,requiresReply = "MessageRecieved")
	@SendTo(RabbitClusterChannel.MESSAGE_CONFIRM_CHANNEL)
	public String  asiaCdsBrokerWarningNotifyMsgRecieve(Message<String> message) {
		System.out.println(RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING+" 消息接收成功：" + message.getPayload());
		return "Get message succesed and returned back to message confirm channel from::"+RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_WARNING;
	}
	
	/**
	 * 
	* @author： Dustyone
	* @Title：asiaCdsBrokerCommonNotifyMsgRecieve 
	* @Description：TODO
	* @param ：@param message 
	* @return ：void 
	* @throws
	 */
	@StreamListener(RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_COMMON)
	@SendTo(RabbitClusterChannel.MESSAGE_CONFIRM_CHANNEL)
	public String asiaCdsBrokerCommonNotifyMsgRecieve(Message<String> message) {
		System.out.println(RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_COMMON+" 消息接收成功：" + message.getPayload());
		return "Get message succesed and returned back to message confirm channel from::"+RabbitClusterChannel.ASIA_CDS_BROKER_NOTIFY_COMMON;
	}
}
